<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>后台管理</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
    <script src="/layui/jquery-3.6.0.min.js"></script>
    <script>
        $(function () {

            layui.use(['form', 'layedit', 'laydate'], function () {
                var form = layui.form
                    , layedit = layui.layedit
                    , laydate = layui.laydate;

                laydate.render({
                    elem: '#date1' //或 elem: document.getElementById('test')、elem: lay('#test') 等
                    , format: 'yyyy-MM-dd HH:mm' //可任意组合
                    ,type: 'datetime'
                    , value: new Date()
                });

                //提交
                form.on('submit(formDemo)', function (data) {
                    // layer.msg(JSON.stringify(data.field));
                    return true;
                });
            });
        })
    </script>
</head>

<body>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>添加产品</legend>
    </fieldset>
    <div class="layui-bg-gray" style="padding: 0px;">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">

                        <form class="layui-form layui-form-pane"    action="/product/add">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">产品编号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="productNum" required lay-verify="required"
                                               placeholder="请输入产品编号" autocomplete="off" class="layui-input" value="${product.productNum}">
                                    </div>
                                    <label class="layui-form-label">产品名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="productName" required lay-verify="required"
                                               placeholder="请输入产品名称" autocomplete="off" class="layui-input"  value="${product.productName}">
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">出发日期</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="departureTime" id="date1" autocomplete="off" class="layui-input"
                                               placeholder="请选择出发日期" value="${product.departureTimeStr}">
                                    </div>
                                    <label class="layui-form-label">出发城市</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="cityName" required lay-verify="required"
                                               placeholder="请输入出发城市" autocomplete="off" class="layui-input" value="${product.cityName}">
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">产品价格</label>
                                    <div class="layui-input-inline">
                                        <input type="number" name="productPrice" required lay-verify="required"
                                                placeholder="请输入产品价格" autocomplete="off" class="layui-input" value="${product.productPrice}">
                                    </div>
                                    <label class="layui-form-label">产品状态</label>
                                    <div class="layui-input-inline">
                                        <select name="productStatus" lay-verify="required" >
                                                <option value="0" selected>关闭</option>
                                                <option value="1" >开启</option>
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">

                                <label class="layui-form-label">产品描述</label>
                                <div class="layui-input-inline"></div>
                                <textarea name="productDesc" style="width:72%" required lay-verify="required" placeholder="请输入产品描述"
                                          class="layui-textarea">${product.productDesc}</textarea>
                            </div>


                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">添加</button>
                                    <a class="layui-btn layui-btn-primary layui-border-blue" href="javascript:history.go(-1)">返回</a>
                                </div>
                            </div>
                        </form>



                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>

</body>

</html>